﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Menu.Master" AutoEventWireup="true" CodeBehind="ColoresItemForm.aspx.cs" Inherits="Emporium_Web.ColoresItemForm" Theme="Constellation" %>

<%@ MasterType VirtualPath="~/Menu.master" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>

<%@ Register src="Search/CombinacionSearch.ascx" tagname="CombinacionSearch" tagprefix="uc1" %>
<%@ Register src="Search/ColorSearch.ascx" tagname="ColorSearch" tagprefix="uc2" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script type="text/javascript">
        function Check(itemId) {
            Regs = document.getElementById('<%= this.hdnSeleccion.ClientID %>');
            Regs.value = itemId;
        }

    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <article class="container_12">
	<section class="grid_12" id="cliente-block">
			<div class="block-border">
			<form id="Form1" runat="server" class="block-content form">
				<h1>Colores</h1>
				 <ajaxtoolkit:toolkitscriptmanager ID="toolk" runat="server"></ajaxtoolkit:toolkitscriptmanager> 

                <div>

                <fieldset>
                
                    <legend>
                        <asp:Label runat="server" ID="leyendaForm"></asp:Label></legend>
                    
                    <ul class="message error no-margin" runat="server" id="errorMessage">
					    <li><asp:Label runat="server" ID="lblErrorMessage"></asp:Label></li>
					</ul>
                    <ul class="message warning no-margin" runat="server"  id="warningMessage">
					    <li><asp:Label runat="server" ID="lblWarningMessage"></asp:Label></li>
					</ul>
                    <br />

                    <div style="width: 100%; height: 45px; float: inherit;">
                        <div style="width: 125px; float: left;">
                            <label>Estilo</label>
                        </div>
                        <div align="left" style="width: 50%; float: left;">                            
                            <asp:TextBox ID="txtEstilo" runat="server" Width="100%" Enabled="false"></asp:TextBox>
                        </div>
                    </div>
                    <div style="width: 100%; height: 45px; float: inherit;">
                        <div style="width: 125px; float: left;">
                            <label>Variante</label>
                        </div>
                        <div align="left" style="width: 50%; float: left;">
                            <asp:TextBox ID="txtVariante" runat="server" Width="100%" Enabled="false"></asp:TextBox>                            
                        </div>
                    </div>
                    <div style="width: 100%; height: 45px; float: inherit;">
                        <div style="width: 125px; float: left;">
                            <label>Componente</label>
                        </div>
                        <div align="left" style="width: 50%; float: left;">
                            <asp:TextBox ID="txtComponente" runat="server" Width="100%" Enabled="false"></asp:TextBox>                            
                        </div>
                    </div>
                    <div style="width: 100%; height: 45px; float: inherit;">
                        <div style="width: 125px; float: left;">
                            <label>Item</label>
                        </div>
                        <div align="left" style="width: 50%; float: left;">
                            <asp:TextBox ID="txtItem" runat="server" Width="100%" Enabled="false"></asp:TextBox>                            
                        </div>
                    </div>

                    <asp:HiddenField ID="hdnSeleccion" runat="server" />

                    <div style="width: 75%; float: inherit;">
                        <label>Combinación - Color</label>
                        <asp:GridView ID="gvCombinacionColor" runat="server" SkinID="gridviewSkin" Width="100%"
                            PageSize="10" AutoGenerateColumns="False">
                        
						<Columns>     
                            <asp:TemplateField>
								<HeaderTemplate>
								</HeaderTemplate>
								<ItemTemplate>
                                       <input id="rbSelect" type="radio" name="selectGroup" value="rbSelect" onclick="javascript:Check('<%# Eval("VarIteComCol_Id") %>');"/>
								</ItemTemplate>
								<HeaderStyle HorizontalAlign="Left"></HeaderStyle>
								<ItemStyle HorizontalAlign="Left" Width="5%" />
							</asp:TemplateField>                         
							<asp:TemplateField HeaderText="Código"  HeaderStyle-HorizontalAlign="Left">
                               <ItemStyle Width="10%" />
                               <ItemTemplate>
                                    <asp:Label ID="lblCodigoCombinación" runat="server" Text='<%# Eval("Combinacion_Id","{0:00000}")%>' ></asp:Label>                                      
                                </ItemTemplate> 
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Combinación"  HeaderStyle-HorizontalAlign="Left">
                                <ItemStyle HorizontalAlign="Left" Width="40%" />
                               <ItemTemplate>
                                    <asp:Label ID="lblDescripcionCombinacion" runat="server" Text='<%# Eval("TG_CombinacionColor.TG_Combinacion.Combinacion_Descripcion") %>' ></asp:Label>                                      
                                </ItemTemplate> 
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Código"  HeaderStyle-HorizontalAlign="Left">
                               <ItemStyle Width="10%" />
                               <ItemTemplate>
                                    <asp:Label ID="lblCodigoColor" runat="server" Text='<%# Eval("Color_Id","{0:00000}")%>' ></asp:Label>                                      
                                </ItemTemplate> 
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Color"  HeaderStyle-HorizontalAlign="Left">
                                <ItemStyle HorizontalAlign="Left" Width="40%" />
                               <ItemTemplate>
                                    <asp:Label ID="lblDescripcionColor" runat="server" Text='<%# Eval("TG_CombinacionColor.TG_Color.Color_Descripcion") %>' ></asp:Label>                                      
                                </ItemTemplate> 
                            </asp:TemplateField>

						</Columns>  
						<PagerSettings Visible="false" />
					</asp:GridView>
                    </div>

                    <div id="divAcciones" runat="server" align="right" style="width:75%; float:inherit; vertical-align:middle; padding-top:15px;">
					        <asp:LinkButton ID="btnComponentesColorAdicionar" runat="server" Text="Adicionar" 
                                CssClass="button" onclick="btnComponentesColorAdicionar_Click"  />
				            <asp:LinkButton ID="btnComponentesColorEliminar" runat="server" Text="Eliminar" 
                                CssClass="button" onclick="btnComponentesColorEliminar_Click" />
				    </div>
                    
                    <br />
                    <div id= "divDetalle" style="width: 72%;float: inherit;" runat="server" class="block-content" visible="false">                        
                         <div style="width: 100%; height: 45px; float: inherit;">
                            <div style="width: 125px; float: left;">
                                <label>Combinación</label>
                            </div>
                            <div align="left" style="width: 100%; float: left;">                            
                                
                                <uc1:CombinacionSearch ID="combinacionSearch" runat="server" ValidationGroup="AceptarAgregar"/>
                                
                            </div>
                        </div>
                        <div style="width: 100%; height: 45px; float: inherit;">
                            <div style="width: 125px; float: left;">
                                <label>Color</label>
                            </div>
                            <div align="left" style="width: 100%; float: left;">                            
                                
                                <uc2:ColorSearch ID="colorSearch" runat="server" ValidationGroup="AceptarAgregar"/>
                                
                            </div>
                        </div>

                        <br />
                        <div align="right" style="width:100%; float:inherit; vertical-align:middle; padding-top:15px;">
					            <asp:LinkButton ID="btnAceptar" runat="server" Text="Aceptar"  ValidationGroup="AceptarAgregar"
                                    CssClass="button" onclick="btnAceptar_Click"  />
				                <asp:LinkButton ID="btnCancelar" runat="server" Text="Cancelar" 
                                    CssClass="button" onclick="btnCancelar_Click" />
				        </div>
                    </div>


                </fieldset>

				<fieldset class="grey-bg no-margin">
				<br />
						<asp:LinkButton ID="btnGrabar" runat="server" CssClass="button red" Text="Grabar" OnClick="btnGrabar_Click" ValidationGroup = "GrabarItem"></asp:LinkButton>
                        <asp:LinkButton ID="btnAtras" runat="server" CssClass="button red" Text="Atrás" OnClick="btnAtras_Click" CausesValidation="false"></asp:LinkButton>
				</fieldset>
                </div>

			</form>
			</div>               
             
		</section>
	</article>
</asp:Content>
